<template>
	<up-navbar bgColor="transparent">
		<template #left>
			<block v-if="pageName">
				<view  class="f-s-18 l-s-2 f-w-b">{{ pageName }}</view>
			</block>
			<block v-else>
				<slot name="top"></slot>
			</block>
		</template>
	</up-navbar>
	<u-sticky :zIndex="9">
		<view class="_top" :style="{
		padding: `${bottom + appendHeight}px 32rpx 28rpx`
	}">
			<slot name="sticky"></slot>
		</view>
	</u-sticky>
	<view class="_area">
		<slot name="area"></slot>
	</view>


</template>

<script setup>
	import {
		hasPreviousPage
	} from '@/utils/common.js';

	

	const props = defineProps({
		pageName: String,
		appendHeight: {
			type: Number,
			default: 16
		}
	})
	const bottom = uni.getMenuButtonBoundingClientRect().bottom
	// 是否存在上一页
	const hasPrev = hasPreviousPage()
</script>

<style lang="scss" scoped>
	._top {
		background-image: url(https://images.debaoppq.cn/2634ff022e194605b1471b80a5d54ece.png);
		background-size: 100% 100%;
		background-repeat: no-repeat;
		// height: 480rpx;
	}

	._area {
		padding: 0 32rpx 32rpx;
	}
</style>